/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.apps.epocket.model;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "dokumen_iklan")
@NamedQueries({
    @NamedQuery(name = "DokumenPengiklanan.findAll", query = "SELECT d FROM DokumenPengiklanan d")})
public class DokumenPengiklanan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)    
    @Column(name = "id_dokumen_iklan")
    private Integer idDokumenIklan;
    
    @Column(name = "fizikal_lokasi")
    private String fizikalLokasi;
    
    @Column(name = "format")
    private String format;
    
    @ManyToOne (fetch = FetchType.LAZY)
    @JoinColumn(name = "id_iklan", nullable = false)
    private Pengiklanan pengiklanan;
    

    public DokumenPengiklanan() {
    }

    public DokumenPengiklanan(Integer idDokumenIklan) {
        this.idDokumenIklan = idDokumenIklan;
    }

    public DokumenPengiklanan(Integer idDokumenIklan, String fizikalLokasi) {
        this.idDokumenIklan = idDokumenIklan;
        this.fizikalLokasi = fizikalLokasi;
    }

    public Integer getIdDokumenIklan() {
        return idDokumenIklan;
    }

    public void setIdDokumenIklan(Integer idDokumenIklan) {
        this.idDokumenIklan = idDokumenIklan;
    }

    public String getFizikalLokasi() {
        return fizikalLokasi;
    }

    public void setFizikalLokasi(String fizikalLokasi) {
        this.fizikalLokasi = fizikalLokasi;
    }

    public Pengiklanan getPengiklanan() {
        return pengiklanan;
    }

    public void setPengiklanan(Pengiklanan pengiklanan) {
        this.pengiklanan = pengiklanan;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDokumenIklan != null ? idDokumenIklan.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DokumenPengiklanan)) {
            return false;
        }
        DokumenPengiklanan other = (DokumenPengiklanan) object;
        if ((this.idDokumenIklan == null && other.idDokumenIklan != null) || (this.idDokumenIklan != null && !this.idDokumenIklan.equals(other.idDokumenIklan))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.apps.epocket.model.DokumenPengiklanan[ idDokumenIklan=" + idDokumenIklan + " ]";
    }
    
}
